package com.ipfsemc.ipfsemc.service.imp;

import com.ipfsemc.ipfsemc.mapper.HomeMapper;
import com.ipfsemc.ipfsemc.model.Home;
import com.ipfsemc.ipfsemc.service.IHomeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class HomeServiceImpl implements IHomeService {

    @Autowired
    private HomeMapper homeMapper;

    @Override
    public int add(Home home) {
        return homeMapper.insertSelective(home);
    }

    @Override
    public int del(Integer homeId) {
        return homeMapper.deleteByPrimaryKey(homeId);
    }

    @Override
    public int update(Home home) {
        return homeMapper.updateByPrimaryKeySelective(home);
    }

    @Override
    public List<Home> list(Home home) {
        return homeMapper.list(home);
    }
}
